import Cookies from 'js-cookie'

const TokenKey = 'heima_renzi_token'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

// 时间戳字段
const timestamp = 'timestamp'

// 存入时间戳
export const setTimeStamp = () => { Cookies.set(timestamp, Date.now()) }
// 获取时间戳
export const getTimeStamp = () => Cookies.get(timestamp)
